package com.lbw.controller;

import com.lbw.domain.User;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;

/**
 * @Author Mr. Liu
 * @Date 2023/3/25 16:48
 */
@RestController
public class TestController {
    @GetMapping("/url/{name}/aaa/{age}")
    public String url(@PathVariable("name") String name,@PathVariable("age") Integer age){
        System.out.println(name);
        System.out.println(age);
        return "ok";
    }

    @GetMapping("/query")
    public String query(@PathParam("name") String name,@PathParam("age") Integer age){
        System.out.println(name);
        System.out.println(age);
        return "ok";
    }

    @PostMapping("body")
    public String body(@RequestBody User user){
        System.out.println(user);
        return "ok";
    }
}
